package han.chensing.latos.game.util;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.g3d.model.Animation;

public class TextureUtil {
    public static TextureRegion[] genAnimationWithTexture(
            Texture texture,int width,int height){
        TextureRegion[][] split = TextureRegion.split(texture, width, height);
        TextureRegion[] regions=new TextureRegion[split.length*split[0].length];
        for (int i=0,k=0;i< split.length;i++){
            for (int j=0;j<split[0].length;j++,k++)
                regions[k]=split[i][j];
        }
        return regions;
    }
}
